<template>
  <div class="cat-container">
    <div class="cat-coupon">
      <p>购物车可领优惠券<span>领券</span></p>
    </div>
    <div class="cat-head">
      <input type="checkbox" />
      <p>全选 <span>商品信息</span></p>
      <p>
        <span>单价</span>
        <span>数量</span>
        <span>小计</span>
        <span>操作</span>
      </p>
    </div>
    <ul class="cat-content">
      <li>
        <div class="one-cat">
          <input type="checkbox" />
          <img
            src="https://yanxuan-item.nosdn.127.net/0333b045c50349472df4545505e1aa20.png?type=webp&quality=95&thumbnail=200x200&imageView"
          />

          <div class="shopdes">
            <span>特价抢购中</span>
            <span>距优惠结束</span>
            <span>18天15小时</span> <br />
            <a href="##"><p>谱写爱的篇章，莫扎特钢笔墨水礼盒</p></a>
            <br />
            <span>莫扎特 红色礼盒</span>
          </div>

          <div class="unit-price">
            <p>¥88.00<span>¥109.00</span></p>
            <p><span>特价</span></p>
          </div>

          <div class="quantity">
            <span>➖</span>
            <input type="text" />
            <span>➕</span>
          </div>

          <div class="price">
            <span>¥19.90</span>
          </div>

          <div class="operation">
            <p>移入收藏夹</p>
            <p>删除</p>
          </div>
        </div>
      </li>
      <li>
        <div class="one-cat">
          <input type="checkbox" />
          <img
            src="https://yanxuan-item.nosdn.127.net/0333b045c50349472df4545505e1aa20.png?type=webp&quality=95&thumbnail=200x200&imageView"
          />

          <div class="shopdes">
            <span>特价抢购中</span>
            <span>距优惠结束</span>
            <span>18天15小时</span> <br />
            <a href="##"><p>谱写爱的篇章，莫扎特钢笔墨水礼盒</p></a>
            <br />
            <span>莫扎特 红色礼盒</span>
          </div>

          <div class="unit-price">
            <p>¥88.00<span>¥109.00</span></p>
            <p><span>特价</span></p>
          </div>

          <div class="quantity">
            <span>➖</span>
            <input type="text" />
            <span>➕</span>
          </div>

          <div class="price">
            <span>¥19.90</span>
          </div>

          <div class="operation">
            <p>移入收藏夹</p>
            <p>删除</p>
          </div>
        </div>
      </li>
    </ul>
    <div class="cat-footer" ref="footerBox">
      <input type="checkbox" />
      <span>全选</span>
      <span>批量删除</span>
      <span>清空已失效商品</span>

      <div class="discount">
        <p>商品合计 :</p>
        <i>¥0.00</i>
        <p>已优惠 :</p>
        <i>-¥0.00</i>
      </div>

      <div class="total">
        <p>应付总额：<span>¥ 0.00</span></p>
      </div>

      <div class="pay">
        <p>下单</p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Card",
  data() {
    return {};
  },
  methods: {},
};
</script>

<style lang="less" scoped>
.cat-container {
  width: 1090px;
  margin: 0 auto;
  margin-bottom: 40px;

  .cat-coupon {
    width: 100%;
    margin: 10px 0 10px 0;
    border: 1px solid #eee;

    p {
      font-size: 14px;
      line-height: 38px;
      padding-left: 30px;

      span {
        height: 100%;
        float: right;
        color: #fff;
        padding: 0 30px 0 30px;
        font-size: 12px;
        background-color: #e36844;
      }
    }
  }

  // 购物车头部
  .cat-head {
    background-color: #f5f5f5;
    border: 1px solid #ccc;

    input {
      width: 17px;
      height: 17px;
      vertical-align: middle;
      margin-left: 20px;
      margin-bottom: 2px;
    }

    p:first-of-type {
      margin-left: 10px;

      span {
        margin-left: 70px;
      }
    }

    p:last-child {
      float: right;

      span:nth-child(3) {
        width: 100px;
      }

      span:last-child {
        width: 100px;
      }

      span {
        display: inline-block;
        width: 180px;
      }
    }

    p {
      display: inline-block;
      line-height: 45px;
      font-size: 13px;
    }
  }

  // 购物车内容
  .cat-content {
    li {
      background-color: #fffbf0;
      border: 1px solid #ccc;
      padding: 20px 0;
      margin-top: 10px;

      .one-cat {
        position: relative;
        input {
          width: 17px;
          height: 17px;
          margin: 0 20px;
        }

        img {
          width: 98px;
          height: 98px;
          background-color: #eee;
          vertical-align: middle;
          border: 1px solid #f0ede3;
        }

        // 商品描述
        .shopdes {
          position: absolute;
          left: 180px;
          top: 0px;

          span:first-child {
            color: #d46f4d;
            border: 1px solid #d46f4d;
            padding: 0 3px;
          }
          span:nth-child(2) {
            color: #999;
            padding: 0 3px;
          }

          a {
            text-decoration: none;
            color: #333;
            font-size: 14px;
            margin: 10px 0;
            display: inline-block;

            :hover {
              color: #c5a078;
            }
          }

          span:last-child {
            color: #999;
          }
        }

        //单价
        .unit-price {
          position: absolute;
          top: 10px;
          left: 500px;

          p:first-child {
            font-size: 14px;
            span {
              color: #999;
              font-size: 12px;
              text-decoration: line-through;
              margin-left: 10px;
            }
          }

          p:nth-child(2) {
            text-align: center;
            margin-top: 10px;

            span {
              color: #d46f4d;
              border: 1px solid #d46f4d;
              padding: 0 3px;
            }
          }
        }

        //数量操作
        .quantity {
          position: absolute;
          top: 10px;
          left: 675px;
          border: 1px solid #ccc;
          input {
            margin: 0 0;
            outline: none;
            border: none;
            text-align: center;
            width: 55px;
            padding: 3px 0;
            border-left: 1px solid #ccc;
            border-right: 1px solid #ccc;
          }

          span {
            color: #999;
            background-color: #fff;
            padding: 3px;
          }
        }

        // 总价
        .price {
          position: absolute;
          left: 880px;
          top: 10px;

          span {
            font-size: 14px;
            color: #d4282d;
          }
        }

        //操作
        .operation {
          position: absolute;
          left: 980px;
          top: 10px;
          font-size: 14px;
          color: #666;

          p {
            padding: 3px;
          }
        }
      }
    }
  }

  //购物车底部
  .cat-footer {
    margin-top: 10px;

    padding: 25px 0;
    background-color: #f5f5f5;
    border: 1px solid #ccc;
    font-size: 14px;
    position: relative;
    input {
      width: 17px;
      height: 17px;
      margin: 0 20px;
      vertical-align: middle;
    }

    span:nth-child(3) {
      margin-left: 30px;
    }
    span:nth-child(4) {
      margin-left: 30px;
    }

    .discount {
      position: absolute;
      top: 13px;
      left: 450px;
      width: 180px;
      padding: 0 40px;
      color: #999;
      border-right: 1px solid #ccc;

      p:nth-of-type(2) {
        margin-top: 10px;
      }

      i {
        position: absolute;
        right: 40px;
      }
      i:first-of-type {
        top: 0;
      }

      i:nth-of-type(2) {
        top: 30px;
      }
    }

    .total {
      position: absolute;
      top: 15px;
      left: 750px;

      p {
        span {
          font-size: 22px;
          vertical-align: middle;
          margin-left: 20px;
          font-weight: 600;
          color: #be4141;
        }
      }
    }

    .pay {
      position: absolute;
      background: #cccccc;
      color: #fff;
      height: 100%;
      right: 0;
      top: 0;
      width: 150px;

      p {
        vertical-align: middle;
        height: 100%;
        margin-top: 22px;
        text-align: center;
        font-size: 20px;
      }
    }
    .active {
      background-color: #b4a078;
    }
  }
}
</style>
